//核心存储
 const STRINGTYPE = "string"
 
 //保存localStorage
 export const setStorage = (key,data)=>{
   if(!key){
     return;
   }
   if(typeof(data)!= STRINGTYPE){
     data=JSON.stringify(data);
   }
   localStorage.setItem(key,data);
 }
 //读取localStorane
 export const getStorage = (key)=>{
   if(!key){
     return;
   }
   return JSON.parse(localStorage.getItem(key));
 }
 //删除
 export const removeStorage = (key)=>{
   if(!key){
     return;
   }
   localStorage.removeItem(key)
 }
 //清空
 export const clearStorage = ()=>{
   localStorage.clear()
 }
